package com.training.java.core.collections.car.pre15;

import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;

import com.training.java.core.collections.laptop.pre15.Laptop;

public class CarListDemo {

	public static void main(String[] args) {

		Car car1 = new Car("Ford", "Focus", 2014, 12000);
		Car car2 = new Car("Toyota", "Corola", 2013, 18000);
		Car car3 = new Car("Honda", "Civic", 2014, 18000);
		
		 List cars = new ArrayList();
			
	       cars.add(car1);
	       cars.add(car2);
	       cars.add(car3);
			
			Iterator carsIterator = cars.iterator();
			
			while(carsIterator.hasNext())
			{
				Car acar = (Car) carsIterator.next();
				System.out.println("Make is " + acar.getMake());
				System.out.println("Model is " + acar.getModel());
				System.out.println("Year is " + acar.getYear());
				System.out.println("Price is " + acar.getPrice());
				System.out.println("*************************");
			}
	}

}
